//


//  AddMeetViewController.m
//  Qihuo
//
//  Created by Vencoo on 13-10-11.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//

#define scrollViewWidth 984

#import "AddMeetViewController.h"
#import "NSDate+Calendar.h"
@interface AddMeetViewController (){
    NSDate *date;
    UIPickerView *fromDatepick;
    UIPickerView *toDatePick;
    UIPickerView *fromTimePick;
    UIPickerView *toTimePick;
    UIScrollView* scrollview;
    NSString *fromDateString;
    NSString *toDateString;
    UILabel *activeDateLabel;
    UILabel *activeTimeLabel;
    UILabel *selType;
    UILabel *normsType;
    UITableView *typeTable;
    UITableView *normsTable;
    NSString *fromTimeString;
    NSString *toTimeString;
    NSArray *places;
    NSMutableArray *placeBtns;
    NSArray *visitZones;
    NSMutableArray *visitBtns;
    NSArray *operations;
    NSMutableArray *numsOfOperation;
    NSArray *drinks;
    NSArray *dinners;
    NSMutableArray *dinnerBtns;
    NSMutableArray *numsOfDrink;
    UIButton *dinBtn;
    NSArray *airConditions;
    NSArray *audiovisuals;
    NSArray *microphones;
    NSArray *constuctions;
    NSMutableArray *percentBtns;
    NSMutableArray *yesNoBtn1;
    NSMutableArray *yesNoBtn2;
    NSArray *securityGovs;
    NSMutableArray *timeLimits;
    NSArray *yesNos;
    
    NSString *yearStr;
    NSString *monthStr;
    NSString *dayStr;
    NSString *hourStr;
    NSString *minuteStr;
    NSString *secondStr;
    UILabel *waitTimeLb;
    UILabel *timeLimitsLb;
    UILabel *typeLb;
    UITextField *activeNameText;
    UITextField *activeNumberText;
    UITextField *numberOfPerson;
    UITextField *OthertextField;
    UITextField *otherTf11;
    UITextField *organizerText;
    UITextField *personText;
    UIButton *typeBtn;
    UIButton *normsBtn;
    BOOL canEdit;
    //    选中的数组或字典
    NSMutableArray *placeSel;
    NSMutableArray *visitZoneSel;
    NSMutableArray *operationSels;
    NSMutableArray *useDinnerSels;
    NSMutableArray *drinkSels;
    NSMutableArray *airconditionSels;
    NSMutableArray *audiovisualSels;
    NSMutableArray *constructionSels;
    NSMutableArray *securitySels;
    NSMutableArray *percentSels;
    NSMutableArray *yesNoSel1;
    NSMutableArray *yesNoSel2;
    NSMutableArray *specialSayMingS;
    NSArray *activeTypes;
    NSArray *activeNorms;
    
    UIImage *roundSelect;
    UIImage *roundUnselect;
    UIImage *rectSelect;
    UIImage *rectUnselect;
    UIImage *inputImage;
    UIImage *tableImage;
    UIImage *lineImage;
    
    NSDictionary *activeTypeDic;
    NSDictionary *activeNormDic;
}

@end

@implementation AddMeetViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"商务活动通知书";

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasHidden:) name:UIKeyboardWillHideNotification object:nil];
    
    roundSelect = [UIImage imageNamed:@"选中"];
    roundUnselect = [UIImage imageNamed:@"未选中"];
    rectSelect = [UIImage imageNamed:@"选择框-2"];
    rectUnselect = [UIImage imageNamed:@"选择框-1"];
    inputImage = [UIImage imageNamed:@"灰底输入框"];
    lineImage = [UIImage imageNamed:@"线"];
    UIImage *labelImage = [UIImage imageNamed:@"底框 2"];
    
    placeSel = [NSMutableArray array];
    [placeSel addObject:@""];
    visitZoneSel = [NSMutableArray array];
    [visitZoneSel addObject:@""];
    operationSels = [NSMutableArray array];
    useDinnerSels = [NSMutableArray array];
    [useDinnerSels addObject:@""];
    drinkSels = [NSMutableArray array];
    airconditionSels = [NSMutableArray array];
    audiovisualSels = [NSMutableArray array];
    constructionSels = [NSMutableArray array];
    securitySels = [NSMutableArray array];
    percentSels = [NSMutableArray array];
    [percentSels addObject:@""];
    yesNoSel1 = [NSMutableArray array];
    [yesNoSel1 addObject:@""];
    yesNoSel2 = [NSMutableArray array];
    [yesNoSel2 addObject:@""];
    
    placeBtns = [NSMutableArray array];
    visitBtns = [NSMutableArray array];
    dinnerBtns = [NSMutableArray array];
    percentBtns = [NSMutableArray array];
    yesNoBtn1 = [NSMutableArray array];
    yesNoBtn2 = [NSMutableArray array];
    specialSayMingS = [NSMutableArray array];
    activeTypes = @[@"参观",@"会议",@"展览",@"视频会议"];
    activeNorms = @[@"特殊",@"一般"];
    yesNos = @[@"是",@"否"];
    
    yearStr = [NSString string];
    monthStr = [NSString string];
    dayStr = [NSString string];
    
    fromDatepick = [[UIPickerView alloc]initWithFrame:CGRectMake(20, 568,scrennWidth/2 - 20, 200)];
    fromDatepick.backgroundColor = [UIColor grayColor];
    fromDatepick.delegate = self;
    fromDatepick.dataSource = self;
    fromDatepick.showsSelectionIndicator = YES;
    
    toDatePick = [[UIPickerView alloc]initWithFrame:CGRectMake(scrennWidth/2, 568, scrennWidth/2 -20, 200)];
    toDatePick.backgroundColor = [UIColor grayColor];
    toDatePick.delegate = self;
    toDatePick.dataSource = self;
    toDatePick.showsSelectionIndicator = YES;
    
    [self.view addSubview:fromDatepick];
    [self.view addSubview:toDatePick];
    fromDatepick.hidden = YES;
    toDatePick.hidden = YES;
    
    fromTimePick = [[UIPickerView alloc]initWithFrame:CGRectMake(20, 568,scrennWidth/2 - 20, 200)];
    fromTimePick.backgroundColor = [UIColor grayColor];
    fromTimePick.delegate = self;
    fromTimePick.dataSource = self;
    fromTimePick.showsSelectionIndicator = YES;
    
    toTimePick = [[UIPickerView alloc]initWithFrame:CGRectMake(scrennWidth/2, 568, scrennWidth/2 - 20, 200)];
    toTimePick.backgroundColor = [UIColor grayColor];
    toTimePick.delegate = self;
    toTimePick.dataSource = self;
    toTimePick.showsSelectionIndicator = YES;
    
    [self.view addSubview:fromTimePick];
    [self.view addSubview:toTimePick];
    fromTimePick.hidden = YES;
    toTimePick.hidden = YES;
    if (_iOS7) {
        scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(20, 80, scrennWidth-40, screenHeight-90)];
    }else{
        scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(20, 60, scrennWidth-40, screenHeight-90)];
    }
    
    scrollview.contentSize = CGSizeMake(scrollview.frame.size.width, 2580);
    [scrollview setBackgroundColor:[UIColor whiteColor]];
    [scrollview setScrollEnabled:YES];
    scrollview.delegate = self;
    [self.view addSubview:scrollview];
    
    UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hiddenAll)];
    [scrollview addGestureRecognizer:gesture];
    
    UIImageView *lineView1 = [[UIImageView alloc]initWithImage:lineImage];
    UIImageView *lineView2 = [[UIImageView alloc]initWithImage:lineImage];
    UIImageView *lineView3 = [[UIImageView alloc]initWithImage:lineImage];
    UIImageView *lineView4 = [[UIImageView alloc]initWithImage:lineImage];
    UIImageView *lineView5 = [[UIImageView alloc]initWithImage:lineImage];
    
    UILabel *title = [UILabel new];
    title.text = @"";
    title.font = [UIFont systemFontOfSize:character*2];
    CGSize acticeSize = [title.text sizeWithFont:title.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    UIImageView *titleView = [[UIImageView alloc]initWithFrame:CGRectMake(0, interval111, scrennWidth, acticeSize.height)];
    title.frame = CGRectMake((scrennWidth - acticeSize.width)/2, 0, acticeSize.width, acticeSize.height);
    [scrollview addSubview:titleView];
    [titleView addSubview:title];
#pragma mark ------- 第一行 活动名称
    UILabel *activeNameLabel = [UILabel new];
    [activeNameLabel setText:@"活动名称："];
    [activeNameLabel setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [activeNameLabel.text sizeWithFont:activeNameLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activeNameLabel.frame = CGRectMake(interval111, interval111+titleView.frame.size.height, acticeSize.width, acticeSize.height);
    [scrollview addSubview:activeNameLabel];
    
    activeNameText = [[UITextField alloc]initWithFrame:CGRectMake(activeNameLabel.frame.size.width + interval111, activeNameLabel.frame.origin.y, tableViewHeight , activeNameLabel.frame.size.height)];
    activeNameText.delegate = self;
    activeNameText.contentVerticalAlignment = UIViewContentModeCenter;
    [activeNameText setBackground:inputImage];
    [scrollview addSubview:activeNameText];
    
    UILabel *acticeNumberLb = [UILabel new];
    acticeNumberLb.text = @"活动编号：";
    acticeNumberLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [acticeNumberLb.text sizeWithFont:acticeNumberLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    acticeNumberLb.frame = CGRectMake(activeNameText.frame.origin.x + activeNameText.frame.size.width + interval111, activeNameText.frame.origin.y, acticeSize.width, acticeSize.height);
    [scrollview addSubview:acticeNumberLb];
    
    activeNumberText = [[UITextField alloc]initWithFrame:CGRectMake(acticeNumberLb.frame.origin.x + acticeNumberLb.frame.size.width, acticeNumberLb.frame.origin.y, 250, acticeSize.height)];
    activeNumberText.delegate = self;
    activeNumberText.contentVerticalAlignment = UIViewContentModeCenter;
    [activeNumberText setBackground:inputImage];
    [scrollview addSubview:activeNumberText];
#pragma mark ------ 第二行 活动日期
    NSDateFormatter *dateFormatter = [NSDateFormatter new];
    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
    
    date = [NSDate date];
    [fromDatepick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.year] IndexOfArray:[NSDate year]] inComponent:0 animated:YES];
    [fromDatepick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.month] IndexOfArray:[NSDate month]] inComponent:1 animated:YES];
    [fromDatepick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.day] IndexOfArray:[NSDate day]] inComponent:2 animated:YES];
    
    [toDatePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.year] IndexOfArray:[NSDate year]] inComponent:0 animated:YES];
    [toDatePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.month] IndexOfArray:[NSDate month]] inComponent:1 animated:YES];
    [toDatePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.day] IndexOfArray:[NSDate day]] inComponent:2 animated:YES];
    
    fromDateString = [dateFormatter stringFromDate:date];
    toDateString = [dateFormatter stringFromDate:date];
    activeDateLabel = [UILabel new];
    [activeDateLabel setFont:[UIFont systemFontOfSize:character]];
    activeDateLabel.text = [NSString stringWithFormat:@"活动日期：%@至%@",fromDateString,toDateString];
    acticeSize = [activeDateLabel.text sizeWithFont:activeDateLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activeDateLabel.frame = CGRectMake(activeNameLabel.frame.origin.x, activeNameLabel.frame.origin.y+activeNameLabel.frame.size.height+interval111, acticeSize.width,acticeSize.height);
    [scrollview addSubview:activeDateLabel];
    
    UIImage *dateImage = [UIImage imageNamed:@"报修单日历按钮"];
    UIButton *dateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [dateBtn setImage:dateImage forState:UIControlStateNormal];
    [dateBtn addTarget:self action:@selector(pickDate) forControlEvents:UIControlEventTouchUpInside];
    dateBtn.frame = CGRectMake(activeDateLabel.frame.size.width + activeDateLabel.frame.origin.x + interval111, activeDateLabel.frame.origin.y, dateImage.size.width, dateImage.size.height);
    [scrollview addSubview:dateBtn];
    //    第三行 活动类型
    UILabel *activeTypeLabel = [UILabel new];
    [activeTypeLabel setFont:[UIFont systemFontOfSize:character]];
    activeTypeLabel.text = @"活动类型：";
    acticeSize = [activeTypeLabel.text sizeWithFont:activeTypeLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activeTypeLabel.frame = CGRectMake(activeDateLabel.frame.origin.x, activeDateLabel.frame.origin.y + activeDateLabel.frame.size.height+interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:activeTypeLabel];
    
    UIImageView *labelView1 = [[UIImageView alloc]initWithImage:labelImage];
    labelView1.frame = CGRectMake(activeTypeLabel.frame.origin.x + activeTypeLabel.frame.size.width, activeTypeLabel.frame.origin.y, labelImage.size.width, labelImage.size.height);
    [scrollview addSubview:labelView1];
    
    selType = [UILabel new];
    selType.text = [activeTypes objectAtIndex:0];
    selType.backgroundColor = [UIColor clearColor];
    [selType setFont:[UIFont systemFontOfSize:character - 3]];
    acticeSize = [[NSString stringWithFormat:@"啊啊啊啊"] sizeWithFont:selType.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    selType.frame = CGRectMake(activeTypeLabel.frame.origin.x + activeTypeLabel.frame.size.width + 3, activeTypeLabel.frame.origin.y + 1.5, acticeSize.width, acticeSize.height);
    [scrollview addSubview:selType];
    
    UIImage *triangleImage = [UIImage imageNamed:@"下拉-按钮1"];
    tableImage = [UIImage imageNamed:@"灰底下拉框"];
    
    typeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    typeBtn.frame = CGRectMake(labelView1.frame.origin.x + labelView1.frame.size.width - triangleImage.size.width, activeTypeLabel.frame.origin.y, triangleImage.size.width, triangleImage.size.height);
    [typeBtn setImage:triangleImage forState:UIControlStateNormal];
    [typeBtn addTarget:self action:@selector(activeType:) forControlEvents:UIControlEventTouchUpInside];
    [scrollview addSubview:typeBtn];
    
    typeTable = [[UITableView alloc]initWithFrame:CGRectMake(selType.frame.origin.x + scrollview.frame.origin.x, selType.frame.origin.y + selType.frame.size.height + scrollview.frame.origin.y, tableImage.size.width, tableImage.size.height) style:UITableViewStylePlain];
    typeTable.dataSource = self;
    typeTable.delegate = self;
    typeTable.backgroundView = [[UIImageView alloc]initWithImage:tableImage];
    typeTable.hidden = YES;
    //    第三行 活动规格
    UILabel *activeNormsLabel = [UILabel new];
    activeNormsLabel.text = @"活动规格：";
    [activeNormsLabel setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [activeNormsLabel.text sizeWithFont:activeNormsLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activeNormsLabel.frame = CGRectMake(typeBtn.frame.origin.x+typeBtn.frame.size.width + interval111, typeBtn.frame.origin.y, acticeSize.width, acticeSize.height);
    [scrollview addSubview:activeNormsLabel];
    
    UIImageView *labelView2 = [[UIImageView alloc]initWithImage:labelImage];
    labelView2.frame = CGRectMake(activeNormsLabel.frame.origin.x + activeNormsLabel.frame.size.width, activeNormsLabel.frame.origin.y, labelImage.size.width, labelImage.size.height);
    [scrollview addSubview:labelView2];
    
    normsType = [UILabel new];
    normsType.text = [activeNorms objectAtIndex:0];
    normsType.backgroundColor = [UIColor clearColor];
    [normsType setFont:[UIFont systemFontOfSize:character - 3]];
    acticeSize = [[NSString stringWithFormat:@"啊啊啊啊"] sizeWithFont:normsType.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    normsType.frame = CGRectMake(activeNormsLabel.frame.origin.x + activeNormsLabel.frame.size.width + 3, activeNormsLabel.frame.origin.y + 1.5, acticeSize.width, acticeSize.height);
    [scrollview addSubview:normsType];
    
    normsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [normsBtn setImage:triangleImage forState:UIControlStateNormal];
    [normsBtn addTarget:self action:@selector(activeNorms:) forControlEvents:UIControlEventTouchUpInside];
    normsBtn.frame = CGRectMake(labelView2.frame.origin.x + labelView2.frame.size.width - triangleImage.size.width, normsType.frame.origin.y - 1.5,triangleImage.size.width,triangleImage.size.height);
    [scrollview addSubview:normsBtn];
    
    normsTable = [[UITableView alloc]initWithFrame:CGRectMake(normsType.frame.origin.x + scrollview.frame.origin.x, normsType.frame.origin.y + normsType.frame.size.height + scrollview.frame.origin.y, tableImage.size.width,tableImage.size.height) style:UITableViewStylePlain];
    normsTable.dataSource = self;
    normsTable.delegate = self;
    normsTable.backgroundView = [[UIImageView alloc]initWithImage:tableImage];
    normsTable.scrollEnabled = YES;
    normsTable.hidden = YES;
    //    第三行 活动人数
    UILabel *activePersonLabel = [UILabel new];
    [activePersonLabel setFont:[UIFont systemFontOfSize:character]];
    activePersonLabel.text = @"活动人数：";
    acticeSize = [activePersonLabel.text sizeWithFont:activePersonLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activePersonLabel.frame = CGRectMake(normsBtn.frame.origin.x+normsBtn.frame.size.width+interval111, normsBtn.frame.origin.y, acticeSize.width,acticeSize.height);
    [scrollview addSubview:activePersonLabel];
    
    numberOfPerson = [[UITextField alloc]initWithFrame:CGRectMake(activePersonLabel.frame.size.width + activePersonLabel.frame.origin.x, activePersonLabel.frame.origin.y, acticeSize.height*2, acticeSize.height)];
    numberOfPerson.delegate = self;
    numberOfPerson.background = inputImage;
    numberOfPerson.contentVerticalAlignment = UIViewContentModeCenter;
    [scrollview addSubview:numberOfPerson];
    //    第四行 活动时间
    NSDateFormatter *timeFormatter = [NSDateFormatter new];
    [timeFormatter setDateFormat:@"HH:mm:ss"];
    
    fromTimeString = [timeFormatter stringFromDate:date];
    toTimeString = [timeFormatter stringFromDate:date];
    
    activeTimeLabel = [UILabel new];
    [activeTimeLabel setFont:[UIFont systemFontOfSize:character]];
    activeTimeLabel.text = [NSString stringWithFormat:@"活动时间：    %@至%@",fromTimeString,toTimeString];
    acticeSize = [activeTimeLabel.text sizeWithFont:activeTimeLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    activeTimeLabel.frame = CGRectMake(activeTypeLabel.frame.origin.x, activeTypeLabel.frame.origin.y + activeTypeLabel.frame.size.height+interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:activeTimeLabel];
    
    [fromTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.hour] IndexOfArray:[NSDate hour]] inComponent:0 animated:YES];
    [fromTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.minute] IndexOfArray:[NSDate minute]] inComponent:1 animated:YES];
    [fromTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.second] IndexOfArray:[NSDate second]] inComponent:2 animated:YES];
    
    [toTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.hour] IndexOfArray:[NSDate hour]] inComponent:0 animated:YES];
    [toTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.minute] IndexOfArray:[NSDate minute]] inComponent:1 animated:YES];
    [toTimePick selectRow:[NSDate object:[NSString stringWithFormat:@"%d",date.second] IndexOfArray:[NSDate second]] inComponent:2 animated:YES];
    
    UIButton *timeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [timeBtn setImage:dateImage forState:UIControlStateNormal];
    [timeBtn addTarget:self action:@selector(pickTime) forControlEvents:UIControlEventTouchUpInside];
    timeBtn.frame = CGRectMake(dateBtn.frame.origin.x, activeTimeLabel.frame.origin.y,dateImage.size.width,dateImage.size.height);
    [scrollview addSubview:timeBtn];
    //第五行 ：承办单位
    UILabel *organizerLabel = [UILabel new];
    [organizerLabel setFont:[UIFont systemFontOfSize:character]];
    organizerLabel.text = @"承办单位/部门：";
    acticeSize = [organizerLabel.text sizeWithFont:organizerLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    organizerLabel.frame = CGRectMake(activeTimeLabel.frame.origin.x, activeTimeLabel.frame.origin.y + activeTimeLabel.frame.size.height+interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:organizerLabel];
    
    organizerText = [[UITextField alloc]initWithFrame:CGRectMake(organizerLabel.frame.size.width + organizerLabel.frame.origin.x, organizerLabel.frame.origin.y, tableViewHeight, organizerLabel.frame.size.height)];
    organizerText.contentVerticalAlignment = UIViewContentModeCenter;
    organizerText.delegate = self;
    organizerText.background = inputImage;
    [scrollview addSubview:organizerText];
    //    第五行 承办人
    UILabel *personLabel = [UILabel new];
    [personLabel setFont:[UIFont systemFontOfSize:character]];
    personLabel.text = @"承办人：";
    acticeSize = [personLabel.text sizeWithFont:personLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    personLabel.frame = CGRectMake(organizerLabel.frame.origin.x, organizerLabel.frame.origin.y + organizerLabel.frame.size.height+interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:personLabel];
    
    lineView1.frame = CGRectMake(0, personLabel.frame.origin.y + personLabel.frame.size.height + 25, lineImage.size.width, 2);
    [scrollview addSubview:lineView1];
    
    personText = [[UITextField alloc]initWithFrame:CGRectMake(personLabel.frame.origin.x+personLabel.frame.size.width, personLabel.frame.origin.y, tableViewHeight, personLabel.frame.size.height)];
    personText.contentVerticalAlignment = UIViewContentModeCenter;
    personText.delegate = self;
    personText.background = inputImage;
    [scrollview addSubview:personText];
    
    //    会议展览
    UILabel *meetingLabel = [UILabel new];
    [meetingLabel setFont:[UIFont systemFontOfSize:character]];
    meetingLabel.text = @"会议/展览";
    acticeSize = [meetingLabel.text sizeWithFont:meetingLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    meetingLabel.frame = CGRectMake(personLabel.frame.origin.x+5, personLabel.frame.origin.y + personLabel.frame.size.height+interval111*2, acticeSize.width, acticeSize.height);
    [scrollview addSubview:meetingLabel];
    
    //    场所
    UILabel *placeLabel = [UILabel new];
    [placeLabel setFont:[UIFont systemFontOfSize:character]];
    placeLabel.text = @"场所：";
    acticeSize = [placeLabel.text sizeWithFont:placeLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    placeLabel.frame = CGRectMake(meetingLabel.frame.origin.x+acticeSize.width/3, meetingLabel.frame.origin.y + meetingLabel.frame.size.height+interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:placeLabel];
    
    OthertextField = [UITextField new];
    OthertextField.delegate = self;
    places = [NSArray arrayWithObjects:@"国际会议厅",@"多功能厅",@"6F视听室",@"37F西餐厅",@"37F贵宾室",@"804会议室",@"801",@"3302",@"3408",@"3604",@"其他：",nil];
    for (int i = 0; i<places.count; i++) {
        UILabel *label = [UILabel new];
        [label setFont:[UIFont systemFontOfSize:character]];
        label.text = [places objectAtIndex:i];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.tag = i;
        [btn setImage:roundUnselect forState:UIControlStateNormal];
        [btn addTarget:self action:@selector(place:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(placeLabel.frame.origin.x + placeLabel.frame.size.width + (scrollViewWidth - placeLabel.frame.size.width - placeLabel.frame.origin.x)/4*(i%4), placeLabel.frame.origin.y + (acticeSize.height+interval111)*(i/4) - 8.5, roundUnselect.size.width,roundUnselect.size.height);
        //        btn.backgroundColor = [UIColor redColor];
        //        NSLog(@"%f   %f  jjjj",roundSelect.size.width,roundSelect.size.height);
        label.frame = CGRectMake(interval111 + btn.frame.origin.x + btn.frame.size.width, btn.frame.origin.y + 7.5, acticeSize.width, acticeSize.height);
        [scrollview addSubview:btn];
        [scrollview addSubview:label];
        [placeBtns addObject:btn];
        if (i == 10) {
            OthertextField.frame = CGRectMake(label.frame.origin.x + label.frame.size.width + interval111, label.frame.origin.y,200,label.frame.size.height);
            OthertextField.background = inputImage;
            OthertextField.contentVerticalAlignment = UIViewContentModeCenter;
            [scrollview addSubview:OthertextField];
        }
    }
    //    参观
    UILabel *visitLabel = [UILabel new];
    visitLabel.text = @"参观";
    [visitLabel setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [visitLabel.text sizeWithFont:visitLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    visitLabel.frame = CGRectMake(meetingLabel.frame.origin.x, placeLabel.frame.origin.y+(placeLabel.frame.size.height+interval111)*3, acticeSize.width, acticeSize.height);
    [scrollview addSubview:visitLabel];
    
    UILabel *zoneLabel = [UILabel new];
    zoneLabel.text = @"参观区域：";
    [zoneLabel setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [zoneLabel.text sizeWithFont:zoneLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    zoneLabel.frame = CGRectMake(placeLabel.frame.origin.x, visitLabel.frame.origin.y+(visitLabel.frame.size.height+interval111), acticeSize.width, acticeSize.height);
    [scrollview addSubview:zoneLabel];
    
    visitZones = [NSArray arrayWithObjects:@"37F西餐厅",@"37F贵宾室",@"6F博物馆",@"4F交易大厅",@"4F计算机房",nil];
    for (int i = 0; i<visitZones.count; i++) {
        UILabel *label = [UILabel new];
        [label setFont:[UIFont systemFontOfSize:character]];
        label.text = [visitZones objectAtIndex:i];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.tag = i;
        [btn addTarget:self action:@selector(visit:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(zoneLabel.frame.origin.x + zoneLabel.frame.size.width + (scrollViewWidth - zoneLabel.frame.size.width - zoneLabel.frame.origin.x)/3*(i%3), zoneLabel.frame.origin.y + (acticeSize.height+interval111)*(i/3) - 8.5, roundUnselect.size.width,roundUnselect.size.height);
        [btn setBackgroundImage:roundUnselect forState:UIControlStateNormal];
        label.frame = CGRectMake(interval111 + btn.frame.origin.x + btn.frame.size.width, btn.frame.origin.y + 7.5, acticeSize.width, acticeSize.height);
        [scrollview addSubview:btn];
        [scrollview addSubview:label];
        [visitBtns addObject:btn];
        //        拿到坐标
        if (i == visitZones.count - 1) {
            _serviceLinePoint = CGPointMake(0, label.frame.origin.y + label.frame.size.height +interval111);
        }
    }
    //    服务要求
    UILabel *serviceOrder = [UILabel new];
    [serviceOrder setFont:[UIFont systemFontOfSize:character+3]];
    serviceOrder.text = @"服务要求";
    acticeSize = [serviceOrder.text sizeWithFont:serviceOrder.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    serviceOrder.frame = CGRectMake((scrollViewWidth-acticeSize.width)/2, _serviceLinePoint.y + interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:serviceOrder];
    
    lineView3.frame = CGRectMake(0, serviceOrder.frame.origin.y - 10, lineImage.size.width, 2);
    lineView2.frame = CGRectMake(0, serviceOrder.frame.origin.y + serviceOrder.frame.size.height + 10, lineImage.size.width, 2);
    [scrollview addSubview:lineView3];
    [scrollview addSubview:lineView2];
    
    //    运作部
    UILabel *operationGov = [UILabel new];
    operationGov.text = @"运作部：";
    [operationGov setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [operationGov.text sizeWithFont:operationGov.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    operationGov.frame = CGRectMake(visitLabel.frame.origin.x, serviceOrder.frame.origin.y +  serviceOrder.frame.size.height + interval111*2, acticeSize.width, acticeSize.height);
    [scrollview addSubview:operationGov];
    
    
    operations = [NSArray arrayWithObjects:@"签到台",@"主席台",@"会标/横幅",@"会议桌",@"贵宾室",@"指示牌",@"座椅",@"绿摆/鲜花",@"毛巾",@"席卡",@"笔",@"垫板",@"白板",@"用餐", nil];
    numsOfOperation = [NSMutableArray array];
    dinners = @[@"7F",@"B1"];
    for (int i = 0; i < operations.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:rectUnselect forState:UIControlStateNormal];
        UILabel *label = [UILabel new];
        label.text = [operations objectAtIndex:i];
        [label setFont:[UIFont systemFontOfSize:character]];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        btn.tag = i;
        [btn addTarget:self action:@selector(operation:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(interval111 + operationGov.frame.size.width + operationGov.frame.origin.x + (scrollViewWidth - operationGov.frame.origin.x - operationGov.frame.size.width)/2*(i%2), operationGov.frame.origin.y + operationGov.frame.size.height + (acticeSize.height + interval111)*(i/2) - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        label.frame = CGRectMake(btn.frame.origin.x + btn.frame.size.width + interval111, btn.frame.origin.y +4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:btn];
        [scrollview addSubview:label];
        
        UILabel *numerLab = [UILabel new];
        numerLab.text = @"数量";
        [numerLab setFont:[UIFont systemFontOfSize:character]];
        acticeSize = [numerLab.text sizeWithFont:numerLab.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        numerLab.frame = CGRectMake(interval111 + operationGov.frame.size.width + operationGov.frame.origin.x +(scrollViewWidth - operationGov.frame.origin.x - operationGov.frame.size.width)/4*((i%2*2)+1), label.frame.origin.y, acticeSize.width, acticeSize.height);
        
        UITextField *numField = [[UITextField alloc]initWithFrame:CGRectMake(numerLab.frame.origin.x + numerLab.frame.size.width + interval111, numerLab.frame.origin.y, acticeSize.height * 2, acticeSize.height)];
        numField.keyboardType = UIKeyboardTypeNumberPad;
        [numsOfOperation addObject:numField];
        numField.tag = 100+i;
        numField.delegate = self;
        numField.contentVerticalAlignment = UIViewContentModeCenter;
        [numField setBackground:inputImage];
        if (i!=2 && i!=5 && i!=9 && i!=13)
        {
            [scrollview addSubview:numerLab];
            [scrollview addSubview:numField];
        }
        else if (i == operations.count - 1)
        {
            for (int j = 0; j < 2; j++) {
                dinBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [dinBtn setImage:roundUnselect forState:UIControlStateNormal];
                dinBtn.frame = CGRectMake(btn.frame.origin.x + (scrollViewWidth - btn.frame.origin.x)/3*(j+1), btn.frame.origin.y -4, roundSelect.size.width, roundSelect.size.height);
                dinBtn.tag = j;
                [scrollview addSubview:dinBtn];
                [dinnerBtns addObject:dinBtn];
                
                UILabel *dinLb = [UILabel new];
                dinLb.text = [dinners objectAtIndex:j];
                [dinLb setFont:[UIFont systemFontOfSize:character]];
                acticeSize = [dinLb.text sizeWithFont:dinLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
                dinLb.frame = CGRectMake(dinBtn.frame.size.width + dinBtn.frame.origin.x +interval111, dinBtn.frame.origin.y + 5, acticeSize.width, acticeSize.height);
                [scrollview addSubview:dinLb];
            }
        }
        
    }
    //    饮料品种
    UILabel *drinkLabel = [UILabel new];
    drinkLabel.text = @"饮料品种：";
    [drinkLabel setFont:[UIFont systemFontOfSize:character]];
    acticeSize = [drinkLabel.text sizeWithFont:drinkLabel.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    drinkLabel.frame = CGRectMake(operationGov.frame.origin.x + acticeSize.width/5*2, (acticeSize.height)*7 + operationGov.frame.origin.y + interval111*9, acticeSize.width, acticeSize.height);
    [scrollview addSubview:drinkLabel];
    
    drinks = @[@"茶水",@"咖啡",@"净水",@"矿水",@"其他"];
    for (int i = 0; i<drinks.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:rectUnselect forState:UIControlStateNormal];
        btn.frame = CGRectMake(drinkLabel.frame.origin.x + drinkLabel.frame.size.width + (scrollViewWidth - drinkLabel.frame.origin.x - drinkLabel.frame.size.width)/2*(i%2), drinkLabel.frame.origin.y + (drinkLabel.frame.size.height + interval111)*(i/2) - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        btn.tag = i;
        [btn addTarget:self action:@selector(selectDinner:) forControlEvents:UIControlEventTouchUpInside];
        [scrollview addSubview:btn];
        
        UILabel *label = [UILabel new];
        label.text = [drinks objectAtIndex:i];
        [label setFont:[UIFont systemFontOfSize:character]];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        label.frame = CGRectMake(btn.frame.size.width + btn.frame.origin.x + interval111, btn.frame.origin.y + 4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:label];
        
        UILabel *numLb = [UILabel new];
        numLb.text = @"数量";
        numLb.font = [UIFont systemFontOfSize:character];
        acticeSize = [numLb.text sizeWithFont:numLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        numLb.frame = CGRectMake(interval111 + drinkLabel.frame.size.width + drinkLabel.frame.origin.x +(scrollViewWidth - drinkLabel.frame.origin.x - drinkLabel.frame.size.width)/4*((i%2*2)+1), label.frame.origin.y, acticeSize.width, acticeSize.height);
        
        UITextField *tf = [UITextField new];
        tf.frame = CGRectMake(numLb.frame.origin.x + numLb.frame.size.width +interval111, numLb.frame.origin.y, acticeSize.height *2, acticeSize.height);
        tf.delegate = self;
        tf.background = inputImage;
        tf.contentVerticalAlignment = UIViewContentModeCenter;
        [numsOfDrink addObject:tf];
        if (i != 4) {
            [scrollview addSubview:numLb];
            [scrollview addSubview:tf];
            tf.keyboardType = UIKeyboardTypeNumberPad;
            tf.tag = 200+i;
        }else{
            UITextField *otherTf = [[UITextField alloc]initWithFrame:CGRectMake(label.frame.origin.x + label.frame.size.width + interval111, label.frame.origin.y, 200 , acticeSize.height)];
            otherTf.background = inputImage;
            otherTf.delegate = self;
            otherTf.contentVerticalAlignment = UIViewContentModeCenter;
            [scrollview addSubview:otherTf];
            otherTf.tag = 204;
        }
    }
    //    特别说明
    UILabel *specialSpeakLb = [UILabel new];
    specialSpeakLb.text = @"特别说明：";
    specialSpeakLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [specialSpeakLb.text sizeWithFont:specialSpeakLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    specialSpeakLb.frame = CGRectMake(drinkLabel.frame.origin.x, drinkLabel.frame.origin.y + (drinkLabel.frame.size.height +interval111)* 3, acticeSize.width, acticeSize.height);
    [scrollview addSubview:specialSpeakLb];
    
    UITextField *specialSpeakTf = [[UITextField alloc]initWithFrame:CGRectMake(specialSpeakLb.frame.size.width + specialSpeakLb.frame.origin.x + interval111, specialSpeakLb.frame.origin.y, 500, acticeSize.height)];
    specialSpeakTf.contentVerticalAlignment = UIViewContentModeCenter;
    specialSpeakTf.delegate = self;
    specialSpeakTf.background = inputImage;
    [scrollview addSubview:specialSpeakTf];
    [specialSayMingS addObject:specialSpeakTf];
    
    lineView4.frame = CGRectMake(0, specialSpeakLb.frame.origin.y + specialSpeakLb.frame.size.height + 25, lineImage.size.width, 2);
    [scrollview addSubview:lineView4];
    
    //    工程部：
    UILabel *projectGovLb = [UILabel new];
    projectGovLb.text = @"工程部：";
    projectGovLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [projectGovLb.text sizeWithFont:projectGovLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    projectGovLb.frame = CGRectMake(operationGov.frame.origin.x, specialSpeakLb.frame.origin.y + specialSpeakLb.frame.size.height + interval111*2, acticeSize.width, acticeSize.height);
    [scrollview addSubview:projectGovLb];
    
    airConditions = @[@"会议/参观场所内外",@"参观廊展柜灯",@"舞台/临时照明"];
    audiovisuals = @[@"背景音乐",@"投影设备",@"图形、音频",@"卡拉OK设备",@"同声翻译",@"话筒"];
    microphones = @[@"有线数量",@"无线数量"];
    constuctions = @[@"多功能厅分隔",@"舞台搭建",@"地毯铺设"];
    securityGovs = @[@"摆放桌椅",@"专梯准备：",@"增强警力",@"警戒栏",@"车辆管理："];
    
    //    空调/照明
    UILabel *airconditionLb = [UILabel new];
    airconditionLb.text = @"空调/照明：";
    airconditionLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [airconditionLb.text sizeWithFont:airconditionLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    airconditionLb.frame = CGRectMake(specialSpeakLb.frame.origin.x, projectGovLb.frame.origin.y + projectGovLb.frame.size.height +interval111, acticeSize.width, acticeSize.height);
    [scrollview addSubview:airconditionLb];
    
    for (int i = 0; i<airConditions.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:rectUnselect forState:UIControlStateNormal];
        btn.tag = i;
        [btn addTarget:self action:@selector(selectAirCondition:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(airconditionLb.frame.origin.x + airconditionLb.frame.size.width+(scrollViewWidth - airconditionLb.frame.size.width - airconditionLb.frame.origin.x)/2*(i%2), airconditionLb.frame.origin.y + (acticeSize.height + interval111)*(i/2) - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        [scrollview addSubview:btn];
        
        UILabel *label = [UILabel new];
        label.text = [airConditions objectAtIndex:i];
        label.font = [UIFont systemFontOfSize:character];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        label.frame = CGRectMake(btn.frame.origin.x + btn.frame.size.width + interval111, btn.frame.origin.y + 4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:label];
    }
    //    视听设备
    UILabel *deviceLb = [UILabel new];
    deviceLb.text = @"视/听设备：";
    deviceLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [deviceLb.text sizeWithFont:deviceLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    deviceLb.frame = CGRectMake(airconditionLb.frame.origin.x ,airconditionLb.frame.origin.y + 3*(acticeSize.height+interval111), acticeSize.width, acticeSize.height);
    [scrollview addSubview:deviceLb];
    
    for (int i = 0; i<audiovisuals.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:rectUnselect forState:UIControlStateNormal];
        if (i < 3) {
            btn.frame = CGRectMake((scrollViewWidth - deviceLb.frame.origin.x - deviceLb.frame.size.width)/3*i+deviceLb.frame.origin.x + deviceLb.frame.size.width, deviceLb.frame.origin.y - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        }else if (i < 5){
            btn.frame = CGRectMake((scrollViewWidth - deviceLb.frame.origin.x - deviceLb.frame.size.width)/3*(i%3) + deviceLb.frame.origin.x + deviceLb.frame.size.width, deviceLb.frame.size.height + deviceLb.frame.origin.y + interval111 - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        }else{
            btn.frame = CGRectMake(deviceLb.frame.origin.x + deviceLb.frame.size.width, deviceLb.frame.origin.y + (deviceLb.frame.size.height + interval111)*2 - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        }
        btn.tag = i;
        [btn addTarget:self action:@selector(selectDevice:) forControlEvents:UIControlEventTouchUpInside];
        [scrollview addSubview:btn];
        
        UILabel *label = [UILabel new];
        label.text = [audiovisuals objectAtIndex:i];
        label.font = [UIFont systemFontOfSize:character];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        label.frame = CGRectMake(btn.frame.origin.x + btn.frame.size.width + interval111, btn.frame.origin.y + 4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:label];
        
        if (i == 5) {
            for (int j = 0; j < microphones.count; j++) {
                UILabel *microLb = [UILabel new];
                microLb.text = [microphones objectAtIndex:j];
                microLb.font = [UIFont systemFontOfSize:character];
                acticeSize = [microLb.text sizeWithFont:microLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
                microLb.frame = CGRectMake(label.frame.origin.x + label.frame.size.width + interval111 * 3 + (acticeSize.width + acticeSize.height + interval111 * 4)*j,label.frame.origin.y , acticeSize.width, acticeSize.height);
                [scrollview addSubview:microLb];
                
                UITextField *numTf = [[UITextField alloc]initWithFrame:CGRectMake(microLb.frame.origin.x + microLb.frame.size.width +interval111, microLb.frame.origin.y, acticeSize.height * 2, acticeSize.height)];
                numTf.tag = 220+j;
                numTf.keyboardType = UIKeyboardTypeNumberPad;
                numTf.background = inputImage;
                numTf.contentVerticalAlignment = UIViewContentModeCenter;
                numTf.delegate = self;
                [scrollview addSubview:numTf];
            }
        }
        
    }
    //    隔断、舞台搭建
    UILabel *constructionLb = [UILabel new];
    constructionLb.text = @"隔断/舞台搭建：";
    constructionLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [constructionLb.text sizeWithFont:constructionLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    constructionLb.frame = CGRectMake(deviceLb.frame.origin.x + deviceLb.frame.size.width - acticeSize.width, deviceLb.frame.origin.y + (acticeSize.height + interval111)*4, acticeSize.width, acticeSize.height);
    [scrollview addSubview:constructionLb];
    for (int i = 0; i < constuctions.count; i++) {
        UILabel *label = [UILabel new];
        label.text = [constuctions objectAtIndex:i];
        label.font = [UIFont systemFontOfSize:character];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        UIButton *firstBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [firstBtn setImage:rectUnselect forState:UIControlStateNormal];
        firstBtn.tag = i;
        [firstBtn addTarget:self action:@selector(construction:) forControlEvents:UIControlEventTouchUpInside];
        firstBtn.frame = CGRectMake(constructionLb.frame.size.width + constructionLb.frame.origin.x, constructionLb.frame.origin.y + (acticeSize.height + interval111)*i - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        label.frame = CGRectMake(firstBtn.frame.origin.x + firstBtn.frame.size.width, firstBtn.frame.origin.y + 4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:firstBtn];
        [scrollview addSubview:label];
        if (i == 0) {//没有写数组
            for (int j =0; j < 4; j++) {
                UIButton *secondBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [secondBtn setImage:roundUnselect forState:UIControlStateNormal];
                secondBtn.tag = j;
//                [secondBtn addTarget:self action:@selector(selectConstruction:) forControlEvents:UIControlEventTouchUpInside];
                secondBtn.frame = CGRectMake(label.frame.origin.x + label.frame.size.width + interval111 +(scrollViewWidth - label.frame.origin.x - label.frame.size.width - (100))/4*j , label.frame.origin.y - 4, roundSelect.size.width, roundSelect.size.height);
                [scrollview addSubview:secondBtn];
                [percentBtns addObject:secondBtn];
                
                UILabel *newLb = [UILabel new];
                switch (j) {
                    case 0:
                    {
                        newLb.text = @"全部";
                    }
                        break;
                    case 1:
                    {
                        newLb.text = @"1/3";
                    }
                        break;
                    case 2:
                    {
                        newLb.text = @"2/3";
                    }
                        break;
                    case 3:
                    {
                        newLb.text = @"其他";
                    }
                        break;
                        
                    default:
                        break;
                }
                newLb.font = [UIFont systemFontOfSize:character];
                acticeSize = [newLb.text sizeWithFont:newLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
                newLb.frame = CGRectMake(secondBtn.frame.origin.x + secondBtn.frame.size.width + interval111, secondBtn.frame.origin.y + 5, acticeSize.width, acticeSize.height);
                [scrollview addSubview:newLb];
                if (j == 3) {
                    otherTf11 = [[UITextField alloc]initWithFrame:CGRectMake(newLb.frame.size.width + newLb.frame.origin.x +interval111, newLb.frame.origin.y, 50, acticeSize.height)];
                    otherTf11.background = inputImage;
                    otherTf11.delegate = self;
                    otherTf11.contentVerticalAlignment = UIViewContentModeCenter;
                    [scrollview addSubview:otherTf11];
                }
            }
            
        }else if (i == 1){
            for (int j = 0; j < 2; j++) {
                UIButton *secondBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [secondBtn setImage:roundUnselect forState:UIControlStateNormal];
                secondBtn.tag = j;
//                [secondBtn addTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
                secondBtn.frame = CGRectMake(label.frame.origin.x + label.frame.size.width + interval111 +(scrollViewWidth - label.frame.origin.x - label.frame.size.width - (100))/4*j+50, label.frame.origin.y - 4, roundUnselect.size.width, roundUnselect.size.height);
                [scrollview addSubview:secondBtn];
                [yesNoBtn1 addObject:secondBtn];
                
                UILabel *yesLabel = [UILabel new];
                switch (j) {
                    case 0:
                    {
                        yesLabel.text = @"是";
                    }
                        break;
                    default:
                    {
                        yesLabel.text = @"否";
                    }
                        break;
                }
                yesLabel.font = [UIFont systemFontOfSize:character];
                yesLabel.frame = CGRectMake(secondBtn.frame.origin.x + secondBtn.frame.size.width + interval111, secondBtn.frame.origin.y + 5, acticeSize.width, acticeSize.height);
                [scrollview addSubview:yesLabel];
            }
        }
        
    }
    NSDateFormatter *limitFormatter = [NSDateFormatter new];
    [limitFormatter setDateFormat:@"yyyy-MM-dd  HH:mm:ss"];
    
    NSDate *waitTime = [NSDate date];
    timeLimits = [NSMutableArray array];
    for (int i =0; i < 3; i++) {
        timeLimitsLb = [UILabel new];
        timeLimitsLb.tag = i;
        timeLimitsLb.text = [NSString stringWithFormat:@"完成时限：%@",[limitFormatter stringFromDate: date]];
        timeLimitsLb.font = [UIFont systemFontOfSize:character];
        acticeSize = [timeLimitsLb.text sizeWithFont:timeLimitsLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        [timeLimits addObject:timeLimitsLb];
        switch (i) {
            case 0:
            {
                timeLimitsLb.frame = CGRectMake(airconditionLb.frame.origin.x + airconditionLb.frame.size.width, airconditionLb.frame.origin.y + (acticeSize.height + interval111)*2, acticeSize.width, acticeSize.height);
            }
                break;
            case 1:
            {
                timeLimitsLb.frame = CGRectMake(deviceLb.frame.origin.x + deviceLb.frame.size.width, deviceLb.frame.origin.y +(deviceLb.frame.size.height + interval111)*3, acticeSize.width, acticeSize.height);
            }
                break;
            case 2:
            {
                timeLimitsLb.frame = CGRectMake(constructionLb.frame.size.width + constructionLb.frame.origin.x, constructionLb.frame.origin.y + (acticeSize.height + interval111)*3, acticeSize.width, acticeSize.height);
            }
                break;
            default:
                break;
        }
        [scrollview addSubview:timeLimitsLb];
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.tag = 100+i;
        [btn setImage:dateImage forState:UIControlStateNormal];
        [btn addTarget:self action:@selector(selectTimeLimit:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(timeLimitsLb.frame.size.width + timeLimitsLb.frame.origin.x +interval111, timeLimitsLb.frame.origin.y, dateImage.size.width,dateImage.size.height);
        [scrollview addSubview:btn];
    }
    UILabel *specialSpeakLb1 = [UILabel new];
    specialSpeakLb1.text = @"特别说明：";
    specialSpeakLb1.font = [UIFont systemFontOfSize:character];
    acticeSize = [specialSpeakLb.text sizeWithFont:specialSpeakLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    specialSpeakLb1.frame = CGRectMake(specialSpeakLb.frame.origin.x, deviceLb.frame.origin.y + (deviceLb.frame.size.height +interval111)* 8, acticeSize.width, acticeSize.height);
    [scrollview addSubview:specialSpeakLb1];
    
    UITextField *specialSpeakTf1 = [[UITextField alloc]initWithFrame:CGRectMake(specialSpeakLb1.frame.size.width + specialSpeakLb1.frame.origin.x + interval111, specialSpeakLb1.frame.origin.y, 500, acticeSize.height)];
    specialSpeakTf1.background = inputImage;
    specialSpeakTf1.contentVerticalAlignment = UIViewContentModeCenter;
    specialSpeakTf1.delegate = self;
    [scrollview addSubview:specialSpeakTf1];
    [specialSayMingS addObject:specialSpeakTf1];
    
    lineView5.frame = CGRectMake(0, specialSpeakLb1.frame.origin.y + specialSpeakLb1.frame.size.height + 25, lineImage.size.width, 2);
    [scrollview addSubview:lineView5];
    
    //安保部
    UILabel *secureGovLb = [UILabel new];
    secureGovLb.text = @"保安部：";
    secureGovLb.font = [UIFont systemFontOfSize:character];
    acticeSize = [secureGovLb.text sizeWithFont:secureGovLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    secureGovLb.frame = CGRectMake(projectGovLb.frame.origin.x, specialSpeakLb1.frame.origin.y + acticeSize.height + interval111 * 2, acticeSize.width, acticeSize.height);
    [scrollview addSubview:secureGovLb];
    
    for (int i = 0; i < securityGovs.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        [btn setImage:rectUnselect forState:UIControlStateNormal];
        btn.tag = i;
        [btn addTarget:self action:@selector(security:) forControlEvents:UIControlEventTouchUpInside];
        btn.frame = CGRectMake(secureGovLb.frame.size.width + secureGovLb.frame.origin.x, secureGovLb.frame.origin.y + secureGovLb.frame.size.height + interval111 +(acticeSize.height + interval111)*(i+(i>1)) - 8.5, rectUnselect.size.width, rectUnselect.size.height);
        [scrollview addSubview:btn];
        
        UILabel *label = [UILabel new];
        label.text = [securityGovs objectAtIndex:i];
        label.font = [UIFont systemFontOfSize:character];
        acticeSize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
        label.frame = CGRectMake(btn.frame.size.width + btn.frame.origin.x + interval111, btn.frame.origin.y + 4, acticeSize.width, acticeSize.height);
        [scrollview addSubview:label];
        
        if (i == 1) {
            waitTimeLb = [UILabel new];
            waitTimeLb.text = [NSString stringWithFormat:@"等待时间 %@",[limitFormatter stringFromDate:waitTime]];
            waitTimeLb.font = [UIFont systemFontOfSize:character];
            acticeSize = [waitTimeLb.text sizeWithFont:waitTimeLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
            waitTimeLb.frame = CGRectMake(label.frame.size.width + label.frame.origin.x + interval111, label.frame.origin.y, acticeSize.width, acticeSize.height);
            [scrollview addSubview:waitTimeLb];
            
            UIButton *waitTimeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
            waitTimeBtn.tag = 103;
            [waitTimeBtn setImage:dateImage forState:UIControlStateNormal];
            [waitTimeBtn addTarget:self action:@selector(selectTimeLimit:) forControlEvents:UIControlEventTouchUpInside];
            waitTimeBtn.frame = CGRectMake(waitTimeLb.frame.origin.x + waitTimeLb.frame.size.width +interval111, waitTimeLb.frame.origin.y, dateImage.size.width,dateImage.size.height);
            [scrollview addSubview:waitTimeBtn];
            
            UILabel *waitFloorLb = [UILabel new];
            waitFloorLb.text = @"等候楼层";
            waitFloorLb.font = [UIFont systemFontOfSize:character];
            acticeSize = [waitFloorLb.text sizeWithFont:waitFloorLb.font constrainedToSize:CGSizeMake(MAXFLOAT ,40)];
            waitFloorLb.frame = CGRectMake(waitTimeLb.frame.origin.x, waitTimeLb.frame.origin.y + waitTimeLb.frame.size.height +interval111, acticeSize.width, acticeSize.height);
            [scrollview addSubview:waitFloorLb];
            
            UITextField *waitFloorTf = [[UITextField alloc]initWithFrame:CGRectMake(waitFloorLb.frame.size.width + waitFloorLb.frame.origin.x + interval111, waitFloorLb.frame.origin.y, waitTimeLb.frame.size.width/2, acticeSize.height)];
            waitFloorTf.tag = 333;
            waitFloorTf.keyboardType = UIKeyboardTypeNumberPad;
            waitFloorTf.background = inputImage;
            waitFloorTf.contentVerticalAlignment = UIViewContentModeCenter;
            waitFloorTf.delegate = self;
            [scrollview addSubview:waitFloorTf];
        }
        else if (i==4)
        {
            UILabel *parkNumLb = [UILabel new];
            parkNumLb.text = @"停车数量";
            parkNumLb.font = [UIFont systemFontOfSize:character];
            acticeSize = [parkNumLb.text sizeWithFont:parkNumLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
            parkNumLb.frame = CGRectMake(label.frame.origin.x + label.frame.size.width + interval111, label.frame.origin.y, acticeSize.width, acticeSize.height);
            [scrollview addSubview:parkNumLb];
            
            UITextField *parkNumTf = [[UITextField alloc]initWithFrame:CGRectMake(parkNumLb.frame.size.width + parkNumLb.frame.origin.x + interval111, parkNumLb.frame.origin.y, acticeSize.width, acticeSize.height)];
            parkNumTf.delegate = self;
            parkNumTf.tag = 334;
            parkNumTf.keyboardType = UIKeyboardTypeNumberPad;
            parkNumTf.background = inputImage;
            parkNumTf.contentVerticalAlignment = UIViewContentModeCenter;
            [scrollview addSubview:parkNumTf];
            
            UILabel *chargeLab = [UILabel new];
            chargeLab.text = @"是否收费：";
            chargeLab.font = [UIFont systemFontOfSize:character];
            acticeSize = [chargeLab.text sizeWithFont:chargeLab.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
            chargeLab.frame = CGRectMake(parkNumTf.frame.origin.x + parkNumTf.frame.size.width + interval111,parkNumTf.frame.origin.y, acticeSize.width, acticeSize.height);
            [scrollview addSubview:chargeLab];
            for (int j = 0; j<2; j++) {
                UIButton *yesBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [yesBtn setImage:roundUnselect forState:UIControlStateNormal];
                yesBtn.tag = j;
//                [yesBtn addTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
                yesBtn.frame = CGRectMake(chargeLab.frame.origin.x + chargeLab.frame.size.width + interval111 + interval111 * 5 * j, chargeLab.frame.origin.y - 8.5, roundUnselect.size.width, roundUnselect.size.height);
                [scrollview addSubview:yesBtn];
                [yesNoBtn2 addObject:yesBtn];
                
                UILabel *yesLabel = [UILabel new];
                switch (j) {
                    case 0:
                    {
                        yesLabel.text = @"是";
                    }
                        break;
                    default:
                    {
                        yesLabel.text = @"否";
                    }
                        break;
                }
                yesLabel.font = [UIFont systemFontOfSize:character];
                yesLabel.frame = CGRectMake(yesBtn.frame.origin.x + yesBtn.frame.size.width + interval111, yesBtn.frame.origin.y + 7.5, acticeSize.width, acticeSize.height);
                [scrollview addSubview:yesLabel];
            }
        }
    }
    UILabel *specialSpeakLb2 = [UILabel new];
    specialSpeakLb2.text = @"特别说明：";
    specialSpeakLb2.font = [UIFont systemFontOfSize:character];
    acticeSize = [specialSpeakLb.text sizeWithFont:specialSpeakLb.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    specialSpeakLb2.frame = CGRectMake(specialSpeakLb1.frame.origin.x, secureGovLb.frame.origin.y + (acticeSize.height + interval111)*7, acticeSize.width, acticeSize.height);
    [scrollview addSubview:specialSpeakLb2];
    
    UITextField *specialSpeakTf2 = [[UITextField alloc]initWithFrame:CGRectMake(specialSpeakLb2.frame.size.width + specialSpeakLb2.frame.origin.x + interval111, specialSpeakLb2.frame.origin.y, 500, acticeSize.height)];
    specialSpeakTf2.background = inputImage;
    specialSpeakTf2.contentVerticalAlignment = UIViewContentModeCenter;
    specialSpeakTf2.delegate = self;
    [scrollview addSubview:specialSpeakTf2];
    [specialSayMingS addObject:specialSpeakTf2];
    //    提交
    UIButton *submitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *subImage = [UIImage imageNamed:@"提交"];
    [submitBtn setImage:subImage forState:UIControlStateNormal];
    submitBtn.frame = CGRectMake((scrollview.frame.size.width - subImage.size.width)/2, specialSpeakLb2.frame.origin.y + specialSpeakLb2.frame.size.height + interval111*2, subImage.size.width, subImage.size.height);
    [submitBtn addTarget:self action:@selector(submit) forControlEvents:UIControlEventTouchUpInside];
    
    [scrollview addSubview:submitBtn];
    [self.view addSubview:typeTable];
    [self.view bringSubviewToFront:typeTable];
    [self.view addSubview:normsTable];
    [self.view bringSubviewToFront:normsTable];
    
    activeTypeDic = @{@"checkId": @"3",@"result":[NSString stringWithFormat:@"%d",0]};
    activeNormDic = @{@"checkId": @"4",@"result":[NSString stringWithFormat:@"%d",0]};
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([tableView isEqual: typeTable]) {
        return activeTypes.count;
    }else{
        return activeNorms.count;
    }
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *identifier = @"myCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    if ([tableView isEqual: typeTable]) {
        cell.textLabel.text = [activeTypes objectAtIndex:indexPath.row];
    }else{
        cell.textLabel.text = [activeNorms objectAtIndex:indexPath.row];
    }
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView == typeTable) {
        selType.text = [activeTypes objectAtIndex:indexPath.row];
        activeTypeDic = @{@"checkId": @"3",@"result":[NSString stringWithFormat:@"%d",indexPath.row]};
    }else{
        normsType.text = [activeNorms objectAtIndex:indexPath.row];
        activeNormDic = @{@"checkId": @"4",@"result":[NSString stringWithFormat:@"%d",indexPath.row]};
    }
    [self hiddenAll];
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return tableImage.size.height/2;
}
#pragma mark - UIPickerViewDataSource
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
    if ([pickerView isEqual:fromDatepick]||[pickerView isEqual:toDatePick]) {
        return 3;
    }else if ([pickerView isEqual:fromTimePick]||[pickerView isEqual:toTimePick]){
        return 3;
    }
    return 0;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
    if ([pickerView isEqual:fromDatepick]||[pickerView isEqual:toDatePick]) {
        switch (component) {
            case 0:
                return [NSDate year].count;
                break;
            case 1:
                return [NSDate month].count;
            case 2:
                return [NSDate day].count;
            default:
                break;
        }
        
    }else if ([pickerView isEqual:fromTimePick]||[pickerView isEqual:toTimePick]){
        switch (component) {
            case 0:
            {
                return [NSDate hour].count;
            }
                break;
            case 1:
            {
                return [NSDate minute].count;
            }
                break;
            case 2:
            {
                return [NSDate second].count;
            }
                break;
                
            default:
                break;
        }
    }
    return 0;
}

#pragma mark - UIPickerViewDelegate
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
    if ([pickerView isEqual:fromDatepick]||[pickerView isEqual:toDatePick])
    {
        switch (component)
        {
            case 0:
            {
                return [[NSDate year]objectAtIndex:row];
            }
                break;
            case 1:
            {
                return [[NSDate month]objectAtIndex:row];
            }
            default:
            {
                return [[NSDate day]objectAtIndex:row];
            }
                break;
        }
    }
    else if ([pickerView isEqual:fromTimePick]||[pickerView isEqual:toTimePick])
    {
        switch (component) {
            case 0:
            {
                return [[NSDate hour]objectAtIndex:row];
            }
                break;
            case 1:
            {
                return [[NSDate minute]objectAtIndex:row];
            }
                break;
            case 2:
            {
                return [[NSDate second]objectAtIndex:row];
            }
                break;
                
            default:
                break;
        }
    }
    return nil;
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    if ([pickerView isEqual:fromDatepick]||[pickerView isEqual:toDatePick]) {
        yearStr = [[NSDate year]objectAtIndex:[pickerView selectedRowInComponent:0]];
        monthStr = [[NSDate month]objectAtIndex:[pickerView selectedRowInComponent:1]];
        dayStr = [[NSDate day]objectAtIndex:[pickerView selectedRowInComponent:2]];
        if ([pickerView isEqual:fromDatepick])
        {
            fromDateString = [NSString stringWithFormat:@"%04d-%02d-%02d",[yearStr intValue],[monthStr intValue],[dayStr intValue]];
        }
        else if ([pickerView isEqual:toDatePick])
        {
            toDateString = [NSString stringWithFormat:@"%04d-%02d-%02d",[yearStr intValue],[monthStr intValue],[dayStr intValue]];
        }
    }
    else if ([pickerView isEqual:fromTimePick]||[pickerView isEqual:toTimePick])
    {
        hourStr = [[NSDate hour]objectAtIndex:[pickerView selectedRowInComponent:0]];
        minuteStr = [[NSDate minute]objectAtIndex:[pickerView selectedRowInComponent:1]];
        secondStr = [[NSDate second]objectAtIndex:[pickerView selectedRowInComponent:2]];
        if ([pickerView isEqual:fromTimePick]) {
            fromTimeString = [NSString stringWithFormat:@"%2d:%02d:%02d",[hourStr intValue],[minuteStr intValue],[secondStr intValue]];
        }else{
            toTimeString = [NSString stringWithFormat:@"%2d:%02d:%02d",[hourStr intValue],[minuteStr intValue],[secondStr intValue]];
        }
    }
    if (fromDatepick.hidden == NO && toDatePick.hidden == NO) {
        activeDateLabel.text = [NSString stringWithFormat:@"活动日期：%@至%@",fromDateString,toDateString];
    }
    if (fromTimePick.hidden == NO && toTimePick.hidden == NO) {
        activeTimeLabel.text = [NSString stringWithFormat:@"活动时间：    %@至%@",fromTimeString,toTimeString];
    }
    if (fromDatepick.hidden == NO && toTimePick.hidden == NO) {
        if (tagggg < 103 && tagggg >= 100)
        {
            UILabel *labelLim =(UILabel*)[timeLimits objectAtIndex:tagggg-100];
            labelLim.text = [NSString stringWithFormat:@"完成时限：%@  %@",fromDateString,toTimeString];
        }
        else if (tagggg == 103)
        {
            waitTimeLb.text = [NSString stringWithFormat:@"等待时间 %@  %@",fromDateString,toTimeString];
        }
    }
}


#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    if ([textField isEqual:OthertextField]) {
        if (canEdit) {
            if (textField.frame.origin.y - scrollview.contentOffset.y>= 768 - scrollview.frame.origin.y - 20 - keyboardSize.width) {
                [scrollview setContentOffset:CGPointMake(scrollview.contentOffset.x, scrollview.contentOffset.y + keyboardSize.width) animated:YES];
            }
            return YES;
        }else{
            return NO;
        }
    }
//    if ([textField isEqual:otherTf11]) {
//        if (percentSels containsObject:<#(id)#>) {
//            <#statements#>
//        }
//    }
    return YES;
}
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
    
    if (textField.frame.origin.y + textField.frame.size.height + scrollview.frame.origin.y- scrollview.contentOffset.y + 5>= 768 - 406)
    {
        [scrollview setContentOffset:CGPointMake(scrollview.contentOffset.x, scrollview.contentOffset.y - (scrollview.frame.size.height - 406 + 10   )+(textField.frame.origin.y + textField.frame.size.height - scrollview.contentOffset.y)) animated:YES];
    }
}
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
    return YES;
}
- (void)textFieldDidEndEditing:(UITextField *)textField
{
    
}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (scrollView == scrollview) {
        [typeBtn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
        [normsBtn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
        typeTable.hidden = YES;
        normsTable.hidden = YES;
        
        typeTable.frame = CGRectMake(selType.frame.origin.x + scrollview.frame.origin.x, selType.frame.origin.y + selType.frame.size.height + scrollview.frame.origin.y - scrollView.contentOffset.y, tableImage.size.width, tableImage.size.height);
        normsTable.frame = CGRectMake(normsType.frame.origin.x + scrollview.frame.origin.x, normsType.frame.origin.y + normsType.frame.size.height + scrollview.frame.origin.y - scrollView.contentOffset.y, tableImage.size.width, tableImage.size.height);
        
        if (typeTable.frame.origin.y <= scrollview.frame.origin.y || normsTable.frame.origin.y <= scrollview.frame.origin.y) {
            typeTable.frame = CGRectMake(selType.frame.origin.x + scrollview.frame.origin.x, scrollview.frame.origin.y, typeTable.frame.size.width, tableImage.size.height - scrollview.contentOffset.y + selType.frame.origin.y + selType.frame.size.height);
            normsTable.frame = CGRectMake(normsType.frame.origin.x + scrollview.frame.origin.x, scrollview.frame.origin.y, tableImage.size.width, tableImage.size.height - scrollview.contentOffset.y + normsType.frame.origin.y + normsType.frame.size.height);
        }
        if (typeTable.frame.origin.y < scrollview.frame.origin.y || normsTable.frame.origin.y < scrollview.frame.origin.y) {
            typeTable.frame = CGRectMake(selType.frame.origin.x + scrollview.frame.origin.x, scrollview.frame.origin.y, 0, 0);
            normsTable.frame = CGRectMake(normsType.frame.origin.x + scrollview.frame.origin.x, scrollview.frame.origin.y, 0, 0);
        }
        
    }
    
}
#pragma mark - keyboardNotification
CGSize keyboardSize;

- (void) keyboardWasShown:(NSNotification *) notif{
    NSDictionary *info = [notif userInfo];
    NSValue *value = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
    keyboardSize = [value CGRectValue].size;
    NSLog(@"keyBoard:%f", keyboardSize.width);  //216
    scrollview.contentSize = CGSizeMake(scrollViewWidth, 2580+keyboardSize.width);
    
}
- (void) keyboardWasHidden:(NSNotification *) notif{
    NSDictionary *info = [notif userInfo];
    NSValue *value = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
    CGSize keyboardSize = [value CGRectValue].size;
    NSLog(@"keyboardWasHidden keyBoard:%f", keyboardSize.width);
    scrollview.contentSize = CGSizeMake(scrollViewWidth, 2580);
}

#pragma mark - button action
- (void)pickDate
{
    typeTable.hidden = YES;
    normsTable.hidden = YES;
    if (fromDatepick.hidden&&toDatePick.hidden) {
        [self hiddenAll];
        fromDatepick.hidden = NO;
        toDatePick.hidden = NO;
        if (_iOS7) {
            scrollview.frame = CGRectMake(20, 80, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }else{
            scrollview.frame = CGRectMake(20, 60, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }

        
    }else{
        [self hiddenAll];
    }
}
- (void)pickTime
{
    typeTable.hidden = YES;
    normsTable.hidden = YES;
    if (fromTimePick.hidden&&toTimePick.hidden) {
        [self hiddenAll];
        fromTimePick.hidden = NO;
        toTimePick.hidden = NO;
        if (_iOS7) {
            scrollview.frame = CGRectMake(20, 80, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }else{
            scrollview.frame = CGRectMake(20, 60, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }

    }else{
        [self hiddenAll];
    }
}
- (void)activeType:(UIButton*)btn
{
    if (typeTable.hidden == YES) {
        [self hiddenAll];
        [btn setImage:[UIImage imageNamed:@"下拉-按钮2"] forState:UIControlStateNormal];
        typeTable.hidden = NO;
    }else{
        [self hiddenAll];
        [btn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
    }
}
- (void)activeNorms:(UIButton*)btn
{
    if (normsTable.hidden == YES) {
        [self hiddenAll];
        [btn setImage:[UIImage imageNamed:@"下拉-按钮2"] forState:UIControlStateNormal];
        normsTable.hidden = NO;
    }else{
        [self hiddenAll];
        [btn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
    }
}

- (NSMutableArray*)place:(UIButton*)sender
{
    [self hiddenAll];
    NSString *last = (NSString*)[places lastObject];
    last = [NSString stringWithFormat:@"%d:%@",sender.tag,OthertextField.text];
    for (UIButton *btn in placeBtns) {
        [btn setImage:roundUnselect forState:UIControlStateNormal];
    }
    [placeSel removeAllObjects];
    [placeSel addObject:[places objectAtIndex:sender.tag]];
    [sender setImage:roundSelect forState:UIControlStateNormal];
    if ([placeSel containsObject:[places lastObject]])
    {
        canEdit = YES;
    }
    else
    {
        canEdit = NO;
    }
    return placeSel;
}
- (NSMutableArray*)visit:(UIButton*)sender
{
    [self hiddenAll];
    for (UIButton *btn in visitBtns) {
        [btn setBackgroundImage:roundUnselect forState:UIControlStateNormal];
    }
    [visitZoneSel removeAllObjects];
    [visitZoneSel addObject:[visitZones objectAtIndex:sender.tag]];
    [sender setBackgroundImage:roundSelect forState:UIControlStateNormal];
    return visitZoneSel;
}
- (void)operation:(UIButton*)sender
{
    [self hiddenAll];
    
    if ([operationSels containsObject:[operations objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [operationSels removeObject:[operations objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [operationSels addObject:[operations objectAtIndex:sender.tag]];
    }
    for (UIButton *btn in dinnerBtns)
    {
        if ([operationSels containsObject:[operations lastObject]])
        {
            [btn addTarget:self action:@selector(useDinner:) forControlEvents:UIControlEventTouchUpInside];
        }
        else
        {
            [btn removeTarget:self action:@selector(useDinner:) forControlEvents:UIControlEventTouchUpInside];
            [btn setImage:roundUnselect forState:UIControlStateNormal];
        }
    }
}

- (void)useDinner:(UIButton*)sender
{
    [self hiddenAll];
    for (UIButton *btn in dinnerBtns) {
        [btn setImage:roundUnselect forState:UIControlStateNormal];
    }
    [useDinnerSels removeAllObjects];
    [useDinnerSels addObject:[dinners objectAtIndex:sender.tag]];
    [sender setImage:roundSelect forState:UIControlStateNormal];
}

- (void)selectDinner:(UIButton*)sender
{
    [self hiddenAll];
    if ([drinkSels containsObject:[drinks objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [drinkSels removeObject:[drinks objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [drinkSels addObject:[drinks objectAtIndex:sender.tag]];
    }
    
}
- (void)selectAirCondition:(UIButton *)sender
{
    [self hiddenAll];
    if ([airconditionSels containsObject:[airConditions objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [airconditionSels removeObject:[airConditions objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [airconditionSels addObject:[airConditions objectAtIndex:sender.tag]];
    }
    
}
- (void)selectDevice:(UIButton*)sender
{
    [self hiddenAll];
    if ([audiovisualSels containsObject:[audiovisuals objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [audiovisualSels removeObject:[audiovisuals objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [audiovisualSels addObject:[audiovisuals objectAtIndex:sender.tag]];
    }
    
}
- (void)construction:(UIButton*)sender
{
    [self hiddenAll];
    if ([constructionSels containsObject:[constuctions objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [constructionSels removeObject:[constuctions objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [constructionSels addObject:[constuctions objectAtIndex:sender.tag]];
    }
    if ([constructionSels containsObject:[constuctions objectAtIndex:0]]) {
        for (UIButton *btn in percentBtns) {
            [btn addTarget:self action:@selector(selectConstruction:) forControlEvents:UIControlEventTouchUpInside];
        }
    }else {
        for (UIButton *btn in percentBtns) {
            [btn removeTarget:self action:@selector(selectConstruction:) forControlEvents:UIControlEventTouchUpInside];
            [btn setImage:roundUnselect forState:UIControlStateNormal];
        }

    }if([constructionSels containsObject:[constuctions objectAtIndex:1]]){
        for (UIButton *btn in yesNoBtn1) {
            [btn addTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
        }
    }else{
        for (UIButton *btn in yesNoBtn1) {
            [btn removeTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
            [btn setImage:roundUnselect forState:UIControlStateNormal];
        }

    }

}
- (void)selectConstruction:(UIButton*)sender
{
    [self hiddenAll];
    for (UIButton *btn in percentBtns) {
        [btn setImage:roundUnselect forState:UIControlStateNormal];
    }
    [percentSels removeAllObjects];
    switch (sender.tag) {
        case 0:
        {
            [percentSels addObject:@"全部"];
  
        }
            break;
        case 1:
        {
            [percentSels addObject:@"1/3"];
 
        }
            break;
        case 2:
        {
            [percentSels addObject:@"2/3"];
 
        }
            break;
            
        default:{
            [percentSels addObject:[NSString stringWithFormat:@"全部：%@",otherTf11.text]];

        }
            break;
    }
    [sender setImage:roundSelect forState:UIControlStateNormal];
}
- (BOOL)yesOrNo:(UIButton*)sender
{
    [self hiddenAll];
    for (UIButton *btn in yesNoBtn1) {
        [btn setImage:roundUnselect forState:UIControlStateNormal];
    }
    [yesNoSel1 removeAllObjects];
    [yesNoSel1 addObject:[yesNos objectAtIndex:sender.tag]];
    [sender setImage:roundSelect forState:UIControlStateNormal];
    
    for (UIButton *btn in yesNoBtn2) {
        [btn setImage:roundUnselect forState:UIControlStateNormal];
    }
    [yesNoSel2 removeAllObjects];
    [yesNoSel2 addObject:[yesNos objectAtIndex:sender.tag]];
    [sender setImage:roundSelect forState:UIControlStateNormal];

    return YES;
}
int tagggg;
- (void)selectTimeLimit:(UIButton*)sender
{
    if (sender.tag == tagggg) {
        if (fromDatepick.hidden&&toTimePick.hidden) {
            [self hiddenAll];
            fromDatepick.hidden = NO;
            toTimePick.hidden = NO;
            if (_iOS7) {
                scrollview.frame = CGRectMake(20, 80, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
            }else{
                scrollview.frame = CGRectMake(20, 60, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
            }
        }else{
            [self hiddenAll];
        }
    }else {
        [self hiddenAll];
        fromDatepick.hidden = NO;
        toTimePick.hidden = NO;
        if (_iOS7) {
            scrollview.frame = CGRectMake(20, 80, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }else{
            scrollview.frame = CGRectMake(20, 60, scrennWidth-40, screenHeight - fromDatepick.frame.size.height - 79);
        }

    }
    tagggg = sender.tag;
}
- (void)security:(UIButton*)sender
{
    [self hiddenAll];
    if ([securitySels containsObject:[securityGovs objectAtIndex:sender.tag]]) {
        [sender setImage:rectUnselect forState:UIControlStateNormal];
        [securitySels removeObject:[securityGovs objectAtIndex:sender.tag]];
    }else{
        [sender setImage:rectSelect forState:UIControlStateNormal];
        [securitySels addObject:[securityGovs objectAtIndex:sender.tag]];
    }
    if ([securitySels containsObject:[securityGovs lastObject]]) {
        for (UIButton *btn in yesNoBtn2) {
            [btn addTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
        }
    }else{
        for (UIButton *btn in yesNoBtn2) {
            [btn removeTarget:self action:@selector(yesOrNo:) forControlEvents:UIControlEventTouchUpInside];
            [btn setImage:roundUnselect forState:UIControlStateNormal];
        }
    }
    
}
- (void)submit
{
    [self hiddenAll];
    NSDictionary *sendCheckData = @{
        @"userId":[[Appinfomation shareIstance].loginDic valueForKey:@"id"],
        @"eventId": [activeNumberText.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eventName": [activeNameText.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eventFromDate": fromDateString,
        @"eventToDate":toDateString,
        @"eventType": [selType.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eventNorm": [normsType.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eventNum": [numberOfPerson.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eventTime": [activeTimeLabel.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"undertater": [organizerText.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"host": [personText.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"place": [[placeSel firstObject] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"area":[[visitZoneSel firstObject] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"regist": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:0]]],
        @"registNum": [[(UITextField *)[scrollview viewWithTag:100] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"rostrum": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:1]]],
        @"rostrumNum": [[(UITextField *)[scrollview viewWithTag:101] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"banner": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:2]]],
        @"meetDesk": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:3]]],
        @"meetDeskNum":[[(UITextField *)[scrollview viewWithTag:103] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"VIPRoom": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:4]]],
        @"VIPRoomNum": [[(UITextField *)[scrollview viewWithTag:104] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"signs": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:5]]],
        @"chair": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:6]]],
        @"chairNum": [[(UITextField *)[scrollview viewWithTag:106] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"flowers": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:7]]],
        @"flowersNum": [[(UITextField *)[scrollview viewWithTag:107] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"towel": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:8]]],
        @"towelNum": [[(UITextField *)[scrollview viewWithTag:108] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"card": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:9]]],
        @"pen": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:10]]],
        @"penNum": [[(UITextField *)[scrollview viewWithTag:110] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"plate": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:11]]],
        @"plateNum": [[(UITextField *)[scrollview viewWithTag:111] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"whiteboard": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:12]]],
        @"whiteboardNum": [[(UITextField *)[scrollview viewWithTag:112] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"dining": [NSString stringWithFormat:@"%i",[operationSels containsObject:[operations objectAtIndex:13]]],
        @"diningPlace": [[useDinnerSels firstObject]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"pantry": [NSString stringWithFormat:@"%i",[drinkSels containsObject:[drinks objectAtIndex:0]]],
        @"pantryNum": [[(UITextField *)[scrollview viewWithTag:200] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"coffee": [NSString stringWithFormat:@"%i",[drinkSels containsObject:[drinks objectAtIndex:1]]],
        @"coffeeNum": [[(UITextField *)[scrollview viewWithTag:201] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"water": [NSString stringWithFormat:@"%i",[drinkSels containsObject:[drinks objectAtIndex:2]]],
        @"waterNum": [[(UITextField *)[scrollview viewWithTag:202] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"mineralWater": [NSString stringWithFormat:@"%i",[drinkSels containsObject:[drinks objectAtIndex:3]]],
        @"mineralWaterNum": [[(UITextField *)[scrollview viewWithTag:203] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"other": [NSString stringWithFormat:@"%i",[drinkSels containsObject:[drinks objectAtIndex:4]]],
        @"otherResult": [[(UITextField *)[scrollview viewWithTag:204] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"oExplanation": [[[specialSayMingS objectAtIndex:0] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"meetPlace": [NSString stringWithFormat:@"%i",[airconditionSels containsObject:[airConditions objectAtIndex:0]]],
        @"cabinetLights": [NSString stringWithFormat:@"%i",[airconditionSels containsObject:[airConditions objectAtIndex:1]]],
        @"illumination": [NSString stringWithFormat:@"%i",[airconditionSels containsObject:[airConditions objectAtIndex:2]]],
        @"completionTime": [[[timeLimits objectAtIndex:0] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"backgroundMusic": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:0]]],
        @"projectionDevice": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:1]]],
        @"audio": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:2]]],
        @"karaOK": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:3]]],
        @"translation": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:4]]],
        @"microphone": [NSString stringWithFormat:@"%i",[audiovisualSels containsObject:[audiovisuals objectAtIndex:5]]],
        @"wiredNum": [[(UITextField *)[scrollview viewWithTag:220] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"wirelessNum": [[(UITextField *)[scrollview viewWithTag:221] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"completionTime1": [[[timeLimits objectAtIndex:1] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"multifunction": [NSString stringWithFormat:@"%i",[constructionSels containsObject:[constuctions objectAtIndex:0]]],
        @"type": [[percentSels firstObject]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"stage": [NSString stringWithFormat:@"%i",[constructionSels containsObject:[constuctions objectAtIndex:1]]],
        @"isFinished": [[yesNoSel1 firstObject]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"carpet": [NSString stringWithFormat:@"%i",[constructionSels containsObject:[constuctions objectAtIndex:2]]],
        @"completionTime2": [[[timeLimits objectAtIndex:2] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"eExplanation": [[[specialSayMingS objectAtIndex:1] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"placedSeat": [NSString stringWithFormat:@"%i",[securitySels containsObject:[securityGovs objectAtIndex:0]]],
        @"designedLadder":[NSString stringWithFormat:@"%i",[securitySels containsObject:[securityGovs objectAtIndex:1]]],
        @"waitTime": [waitTimeLb.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"waitFloor": [[(UITextField *)[scrollview viewWithTag:333] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"enhancedPolice":  [NSString stringWithFormat:@"%i",[securitySels containsObject:[securityGovs objectAtIndex:2]]],
        @"guardColumn":  [NSString stringWithFormat:@"%i",[securitySels containsObject:[securityGovs objectAtIndex:3]]],
        @"carManagement":  [NSString stringWithFormat:@"%i",[securitySels containsObject:[securityGovs objectAtIndex:4]]],
        @"parkingNum": [[(UITextField *)[scrollview viewWithTag:334] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"isCharge": [[yesNoSel2 firstObject]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
        @"sExplanation": [[[specialSayMingS objectAtIndex:2] text] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
        };
    
    NSString *str1 =[sendCheckData JSONRepresentation];
    NSURL *sendUrl = [NSURL URLWithString:addMeeting];
    ASIFormDataRequest *sendRequest = [ASIFormDataRequest requestWithURL:sendUrl];
    sendRequest.delegate = self;
    [sendRequest setPostValue:str1 forKey:@"data"];
    [sendRequest startAsynchronous];
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    [sendRequest setDidFinishSelector:@selector(submitDone)];
    [sendRequest setDidFailSelector:@selector(submitFail)];
    NSLog(@"%@",sendCheckData);
    
}

- (void)hiddenAll
{
    
    if (_iOS7) {
        scrollview.frame = CGRectMake(20, 80, scrennWidth-40, screenHeight-90);
    }else{
        scrollview.frame = CGRectMake(20, 60, scrennWidth-40, screenHeight-90);
    }

    typeTable.hidden = YES;
    normsTable.hidden = YES;
    fromTimePick.hidden = YES;
    toTimePick.hidden = YES;
    fromDatepick.hidden = YES;
    toDatePick.hidden = YES;
    [typeBtn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
    [normsBtn setImage:[UIImage imageNamed:@"下拉-按钮1"] forState:UIControlStateNormal];
    
    [[[UIApplication sharedApplication]keyWindow]endEditing:YES];
}
- (void)submitDone
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
    UIAlertView *successAlert = [[UIAlertView alloc]initWithTitle:@"提示！" message:@"数据提交成功！" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
    successAlert.tag = 1010;
    [successAlert show];
}
- (void)submitFail
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
    UIAlertView *successAlert = [[UIAlertView alloc]initWithTitle:@"警告！" message:@"数据提交失败！！！" delegate:self cancelButtonTitle:@"重新提交" otherButtonTitles:@"取消", nil];
    successAlert.tag = 1011;
    [successAlert show];

}
#pragma mark - UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView.tag == 1010)
    {
        [self.navigationController popViewControllerAnimated:YES];
    }
    else if(alertView.tag == 1011)
    {
        switch (buttonIndex) {
            case 0:
            {
                [self submit];
            }
                break;
            case 1:
            {
                
            }
            default:
                break;
        }
    }
}
#pragma mark - end
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
@end
